try:
    value_at_index_0 = df.loc[0]
except KeyError:
    print(f"Index {0} does not exist in the DataFrame.")